﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model;
using FG_Admin_DAL;

namespace FG_Admin_BLL
{
    public class AdminsBLL
    {
        AdminsDAL dal = new AdminsDAL();
        /// <summary>
        /// 分页显示所有管理员信息
        /// </summary>
        /// <param name="PageIndex"></param>
        /// <param name="PageSize"></param>
        /// <returns></returns>
        public List<FG_Admin_DAL.Models.AdminsMessage> GetAdmins(int PageIndex, int PageSize)
        {
            return dal.GetAdmins(PageIndex, PageSize);
        }
        /// <summary>
        /// 显示当前管理员信息
        /// </summary>
        /// <param name="PageIndex"></param>
        /// <param name="PageSize"></param>
        /// <param name="AdminsID"></param>
        /// <returns></returns>
        public FG_Admin_DAL.Models.AdminsMessage GetAdmins(int PageIndex, int PageSize, int AdminsID)
        {
            return dal.GetAdmins(PageIndex, PageSize, AdminsID);
        }
        /// <summary>
        /// 显示所有管理员信息
        /// </summary>
        /// <returns></returns>

        public List<FG_Admin_DAL.Models.AdminsMessage> GetAdmins()
        {
            return dal.GetAdmins();
        }
        /// <summary>
        /// 修改管理员信息
        /// </summary>
        /// <param name="mes"></param>
        /// <returns></returns>
        public int EditAdmins(FG_Admin_DAL.Models.AdminsMessage mes)
        {
            return dal.EditAdmins(mes);

        }
        /// <summary>
        /// 修改管理员角色权限
        /// </summary>
        /// <param name="RID">角色编号</param>
        /// <param name="str">权限编号字符串</param>
        /// <returns></returns>
        public int EditPower(int RID, string str)
        {
            return dal.EditPower(RID, str);
        }
        /// <summary>
        /// 显示相关角色的权限信息
        /// </summary>
        /// <param name="RID"></param>
        /// <returns></returns>
        public List<Admins_Power> GetPower(int RID)
        {
           return  dal.GetPower(RID);
        }
        /// <summary>
        /// 登陆人员验证
        /// </summary>
        /// <param name="Name"></param>
        /// <param name="Pwd"></param>
        /// <returns></returns>
        public int LoginDo(string Name, string Pwd)
        {
            return dal.LoginDo(Name, Pwd);
        }
    }
}
